/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ordenacao;

/**
 *
 * @author Jorge
 */
public class SelectionSort {

    public static void SelectionSort(Object[] objeto, int tamanho) {
        Object [] aux = null;
        int tam = tamanho;
        int index_min;
        for (int i = 0; i < tam - 1; i++) {
            index_min = i;
            for (int j = i + 1; j < tam; j++) {
                if (objeto[j].toString().charAt(j) < objeto[index_min].toString().charAt(j+1)) {
                    index_min = j;
                }
            }
        
        if (index_min != i) {
            aux[i] = objeto[index_min];
            objeto[index_min] = objeto[i];
            objeto[i] = aux;
        }
    }
}}

